import java.util.*;

/**
 * @author LKQ
 * @date 2022/5/2 20:03
 * @description 曼哈顿距离 dis(A, B)表示 A点到 B点的曼哈顿距离，那么 dis(A, B) = |xa - xb| + |ya - yb|
 */
public class Solution {
    public static void main(String[] args) {

    }
    public boolean escapeGhosts(int[][] ghosts, int[] target) {
        int[] source = {0, 0};
        int distance = manhattanDistance(source, target);
        for (int[] ghost : ghosts) {
            int ghostDistance = manhattanDistance(ghost, target);
            if (ghostDistance <= distance) {
                // 只要阻碍者先一步到达终点，那么就不可能逃脱
                return false;
            }
        }
        return true;
    }

    public int manhattanDistance(int[] point1, int[] point2) {
        return Math.abs(point1[0] - point2[0]) + Math.abs(point1[1] - point2[1]);
    }
}
